import { PIC_URL } from './../../providers/Config';
import { Events } from 'ionic-angular';
import { BasePage } from './../../pages/basePage';
import { UserService } from './../../providers/UserService';
import { Component, Injector } from '@angular/core';
/**
 * Generated class for the ShopNoServicesComponent component.
 *
 * See https://angular.io/api/core/Component for more info on Angular
 * Components.
 */
@Component({
  selector: 'shop-no-services',
  templateUrl: 'shop-no-services.html'
})
export class ShopNoServicesComponent extends BasePage {
  picrooturl = '';
  shopList = [];
  noMsg: boolean;

  constructor(injector: Injector, public userService: UserService, public events: Events) {
    super(injector);
    this.picrooturl = PIC_URL;
    this.events.subscribe('shop:created', (status, id) => {
      console.log(id);
      this.shopList = [];
      if (id == 2) {
        this.shopList = status;
        console.log(this.shopList);
        this.noMsg = this.shopList.length == 0 ? true : false;
        return;
      }
    });
  }
}
